module game
{
	/**
	 * 创建管理器
	 * 创建和管理不同的创建
	 */
	export class SceneManager
	{
		private static _instance:SceneManager;
		private initCallBack:Function;
		private initThisObj:any;
		private myScene:BaseScene;

		public constructor()
		{
		}

		public static getInstance():SceneManager
		{
			if(this._instance == null)
			{
				this._instance = new SceneManager();
			}
			return this._instance;
		}

		/**初始化 */
		public init(callBack:Function,thisObj:any):void
		{
			this.initCallBack = callBack;
			this.initThisObj = thisObj;
			RES.getResAsync("scene1_json",this.configLoad,this);
		}

		private configLoad(data:any):void
		{
			console.warn(JSON.stringify(data));
			this.initCallBack.call(this.initThisObj);

			// this.myScene = new BaseScene();
			// this.myScene.init(data.map,data.row,data.col,data.name,data.default,data.types);

			// LayerManager.root.addChild(this.myScene);
			// this.myScene.x = 122;
			// this.myScene.y = 100;

			// GameManager.getInstance().upload_map(data);
		}
	}
}